*********************************************************************************
/*  Create scatter plot for revenue and costs by year and income for NRP audits */
*********************************************************************************
* File paths
local datapath "${mvpf_audits}/data/cleaned" 
local rawdatapath "${mvpf_audit}/data/outside"
local graphpath "${graphpath}" 
local dofilepath "${mvpf_audits}/code/prep" 

local multiplier_yr = 2003
local inc = "tpi"

use "${mvpf_audits}/data/figures_rep/ap11.dta", clear
	
	tw  (connected rev_tot_disc primary_yr if ${inc}_pctl==1) ///
		(connected rev_tot_disc primary_yr if ${inc}_pctl==5) ///
		(connected rev_tot_disc primary_yr if ${inc}_pctl==10) ///
		(connected rev_tot_disc primary_yr if ${inc}_pctl==15) ///
		(connected rev_tot_disc primary_yr if ${inc}_pctl==20) ///
		(connected rev_tot_disc primary_yr if ${inc}_pctl==21) ///
		, ///
		yscale(r()) ///
		ytitle("Dollars per audit ($)") xtitle("Year")   ///
		legend(ring(0) pos(11) col(2) symxsize(*0.2) order(6 5 4 3 2 1) ///
		lab(1 "0-5") lab(2 "20-25") lab(3 "45-50") lab(4 "70-75") lab(5 "95-99") lab(6 "99-99.9") ) ///
		ylab( , nogrid format(%9.0fc)) ///
		${title} ${axis_size} ///
		xscale()  ///
		xlabel(, nogrid ) 	
	graph export "`graphpath'/connected_rev_tot_inc_yr_nrp.wmf", as(wmf) replace
	
	tw  (connected costs_tot_future primary_yr if ${inc}_pctl==1) ///
		(connected costs_tot_future primary_yr if ${inc}_pctl==5) ///
		(connected costs_tot_future primary_yr if ${inc}_pctl==10) ///
		(connected costs_tot_future primary_yr if ${inc}_pctl==15) ///
		(connected costs_tot_future primary_yr if ${inc}_pctl==20) ///
		(connected costs_tot_future primary_yr if ${inc}_pctl==21) ///
		, ///
		yscale(r()) ///
		ytitle("Dollars per audit ($)") xtitle("Year")   ///
		legend(ring(0) pos(11) col(2) symxsize(*0.2) order(6 5 4 3 2 1) ///
		lab(1 "0-5") lab(2 "20-25") lab(3 "45-50") lab(4 "70-75") lab(5 "95-99") lab(6 "99-99.9") ) ///
		ylab( , nogrid format(%9.0fc)) ///
		${title} ${axis_size} ///
		xscale()  ///
		xlabel(, nogrid ) 	
	graph export "`graphpath'/connected_costs_tot_inc_yr_nrp.wmf", as(wmf) replace